package com.jt.www.admin.user.service;

import com.jt.www.domain.vo.PromotersVo;
import com.jt.www.domain.vo.RegisterCustomerVo;
import com.jt.www.model.registerCustomer.RegisterCustomer;
import com.jt.www.model.registerCustomer.vo.*;
import com.jt.www.model.reps.GenericDataResponse;
import com.jt.www.model.reps.GenericListResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface RegisterCustomerService {

    /**
     * 绑定推广关系
     *
     * @param findCode
     * @param registerCustomer
     * @return
     */
    ResponseEntity insertBinaryRegisterCustomer(String findCode, RegisterCustomer registerCustomer);

    /**
     * 查询推广关系列表
     *
     * @param findCode
     * @param customerListParam
     * @return
     * @throws Exception
     */
    ResponseEntity<GenericListResponse<RegisterCustomerVo>> queryCustomers(String findCode, CustomerListParam customerListParam) throws Exception;

    /**
     * 查询推广人信息
     *
     * @param findCode
     * @param userCode
     * @return
     */
    ResponseEntity<GenericDataResponse<ManagerInfoVo>> queryPromotersInfo(String findCode, String userCode);

    /**
     * 业绩查询（推广）
     *
     * @param achievementListQo
     * @return
     * @throws Exception
     */
    ResponseEntity<GenericListResponse<AchievementListVO>> queryAchievementList(String findCode, AchievementListQo achievementListQo) throws Exception;

    /**
     * 业绩查询（推广）导出
     *
     * @param param
     * @return
     */
    List<AchievementListVO> exportAchievementList(AchievementExportQo param) throws Exception;

    /**
     * 定时更新推广人基础信息
     */
    void managerEffect();


    /**
     * 内部人员配置接口
     *
     * @param findCode
     * @param registerCustomer
     * @param level
     * @return
     */
    ResponseEntity setManager(String findCode, RegisterCustomer registerCustomer, String level);

    /**
     * 查询推广人信息
     *
     * @param findCode
     * @param employeeNum 员工编号
     * @return
     */
    ResponseEntity<GenericDataResponse<PromotersVo>> queryPromotersByEmployeeNum(String findCode, String employeeNum);

    /**
     * 解除推广关系
     *
     * @param findCode
     * @param id
     * @param isDeleted 是否删除记录
     * @return
     */
    int removePromotionById(String findCode, Integer id, boolean isDeleted);

    /**
     * 关系转移
     *
     * @param findCode
     * @param registerCustomer
     * @return
     */
    ResponseEntity transferPromotionById(String findCode, RegisterCustomer registerCustomer);

    /**
     * 检查并处理有效性
     *
     * @param registerCustomer
     * @return false表示该推广关系不合法 推广人 不能做为推广人
     */
    ResponseEntity<GenericDataResponse<RegisterCustomer>> checkValidity(String findCode, RegisterCustomer registerCustomer);


    /**
     * 通过客户帐号 查询推广人信息
     *
     * @param findCode
     * @param customerAccount
     * @return
     */
    ResponseEntity<GenericDataResponse<ManagerInfoVo>> queryPromoterByCustomerAccount(String findCode, String customerAccount);

    /**
     * 保单绑定推广人
     *
     * @param excelFile
     * @return
     */
    ResponseEntity policyAgent(MultipartFile excelFile);
}
